Hi, i want to style my unit with a smart tree structure with + and - icons that hide or show sublevels if the element cliccked has any.
I can't figure out how to style the list recurisvely.
My current non valid soutions are to show eveerything at the same level (all leafs with no sub levels), or every level it's the only child of its parent with the result of course of a long list from the root to the last child and every level is nested one in each other.
I'm currently looping the elements with a "forEach":
< c:forEach var="currentItem" varStatus="currentStatus" items="${<wr:unitid/>.data}">
...
< /c:forEach>
I also would like styling the list with the '< ul>' tag:
< ul>
< c:forEach ...>
< li>
[invoke a recursive function like "getSubLevelsLayout" to style all sublevels of this current one]
< /li>
< /c:forEach>
< ul>
In this way i immagine having a situation like:
< ul>
< li>
< ul>
< li>< /li>
< li>< /li>
< /ul>
< /li>
How can i loop through the elements and recursively find out which is child, which is a sibling element or new level lf the tree?
Thanks, Enrico Luzi